home *** CD-ROM | disk | FTP | other *** search
- package classes.game
- {
- import classes.Main;
- import flash.display.MovieClip;
- import libs.kjc.KJC_enterframe;
-
- [Embed(source="/_assets/assets.swf", symbol="classes.game.Tom")]
- public dynamic class Tom extends MovieClip
- {
-
-
- private var tx:int;
-
- public var hit:MovieClip;
-
- internal var id:int;
-
- public function Tom()
- {
- super();
- addFrameScript(0,frame1,7,frame8,15,frame16,31,frame32,46,frame47,62,frame63,103,frame104);
- reSetTom();
- }
-
- internal function reSetTom() : void
- {
- this.gotoAndStop(1);
- id = -1;
- tx = 250;
- KJC_enterframe.moveToValue(this,tx,4,"x");
- }
-
- internal function frame1() : *
- {
- id = -1;
- }
-
- internal function frame63() : *
- {
- this.gotoAndStop(1);
- }
-
- internal function frame32() : *
- {
- this.gotoAndStop(1);
- }
-
- internal function frame8() : *
- {
- this.gotoAndStop(1);
- }
-
- internal function frame104() : *
- {
- this.gotoAndStop(1);
- }
-
- internal function frame47() : *
- {
- this.gotoAndStop(1);
- }
-
- internal function frame16() : *
- {
- this.gotoAndStop(1);
- }
-
- internal function actionTom(param1:String) : void
- {
- if(id == -2)
- {
- return;
- }
- switch(param1)
- {
- case "LEFT":
- tx -= 70;
- if(tx < 40)
- {
- tx = 40;
- return;
- }
- id = -1;
- Main.playSound(4);
- KJC_enterframe.moveToValue(this,tx,4,"x");
- break;
- case "RIGHT":
- tx += 70;
- if(tx > 460)
- {
- tx = 460;
- return;
- }
- id = -1;
- Main.playSound(4);
- KJC_enterframe.moveToValue(this,tx,4,"x");
- break;
- case "Z":
- id = 0;
- break;
- case "X":
- id = 1;
- break;
- case "C":
- id = 2;
- break;
- case "FAIL":
- Main.playSound(3);
- id = -2;
- break;
- default:
- return;
- }
- this.gotoAndPlay(param1);
- }
- }
- }
-